package me.liuyu2783.dubbo.sample;

import me.liuyu2783.dubbo.sample.api.HelloService;
import me.liuyu2783.dubbo.sample.dubbo.*;
import me.liuyu2783.dubbo.sample.service.HelloServiceImpl;

/**
 * me.liuyu2783.dubbo.sample.tomcat
 *
 * @author liuyu2783
 * @date 2020-3-3
 */
public class Provider {

    public static void main(String[] args) {
        //本地注册
        LocalRegister.regist(HelloService.class.getName(), HelloServiceImpl.class);

        //远程注册
        URL url = new URL("localhost", 8888);
        RemoteRegister.regist(HelloService.class.getName(), url);

        //服务启动
//        new HttpServer().start();

//        Protocol protocol = new HttpProtocol();
//        protocol.start(url);

        Protocol protocol = ProtocolFactory.getProtocal();
        protocol.start(url);
    }
}
